﻿@model BlogWeb.Models.AdLogin

@{
    ViewBag.Title = "小小强的个人博客--管理员登录";
    Layout = "~/Views/Shared/_LayoutAdminLogin.cshtml";
}

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    <div class="Main">
        <ul>
            <li class="top"></li>
            <li class="top2"></li>
            <li class="topA"></li>
            <li class="topB"><span><img src="~/Content/admin/images/login/logo.png" alt="" style="" /></span></li>
            <li class="topC"></li>
            <li class="topD">
                <ul class="login">
                    <li>
                        <span class="left login-text">用户名：</span> <span style="text-align:left;">
                             @Html.EditorFor(model => model.Acc, new { htmlAttributes = new { @class = "txt" } })
                             @Html.ValidationMessageFor(model => model.Acc, "", new { @class = "text-danger" })
                        </span>
                    </li>
                    <li>
                        <span class="left login-text">密码：</span> <span style="text-align:left;">
                            @Html.PasswordFor(model => model.Pwd,  new { @class = "txt" })
                            @Html.ValidationMessageFor(model => model.Pwd, "", new { @class = "text-danger" })
                        </span>
                    </li>
                    <li>
                        <span class="left login-text">验证码：</span> <span style="text-align:left;">
                            @Html.EditorFor(model => model.ChkCode, new { htmlAttributes = new { @class = "txt" } })
                            
                            @Html.ValidationMessageFor(model => model.ChkCode, "", new { @class = "text-danger" })

                        </span>
                    </li>
                </ul>
            </li>
            <li class="topE"></li>
            <li class="middle_A"></li>
            <li class="middle_B"></li>
            <li class="middle_C">
                <span class="btn">
                    <input name="" type="image" src="~/Content/admin/images/login/btnlogin.gif" />
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <img id="valiCode" style="cursor: pointer;" class="col-md-2 control-label" src="~/ChkCode/GetValidateCode" alt="验证码" height="35" width="50" />
                 </span>
            </li>
            <li class="middle_D"></li>
            <li class="bottom_A"><h2 style="text-align:center; color:red;">@Html.ValidationSummary(true, "", new { @class = "text-danger" })</h2></li>
            <li class="bottom_B">小小强的个人博客后台管理</li>
        </ul>
    </div>   
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script type="text/javascript">
        $(function () {
            $("#valiCode").bind("click", function () {
                this.src = "../ChkCode/GetValidateCode?time=" + (new Date()).getTime();
            });
        });

        //禁止浏览器回退按钮事件
        $(document).ready(function (e) {
            var counter = 0;
            if (window.history && window.history.pushState) {
                $(window).on('popstate', function () {
                    window.history.pushState('forward', null, '#');
                    window.history.forward(1);
                });
            }

            window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
            window.history.forward(1);
        });
    </script>
}
